package ch3.queue.link;

public class Exam3_13 {
    public static void main(String[] args) {
        //测试1
        System.out.println("*******测试1****************");
        Integer[] a = {1, 2, 3, 4, 5};
        CycleLinkQueueClass<Integer> st1 = new CycleLinkQueueClass<Integer>();

        for (int i = 0; i < a.length; i++) {
            st1.push(a[i]);
            System.out.println("进队元素: " + a[i]);
        }
        System.out.println("st1为空: " + st1.empty());
        System.out.println("st1: " + st1);

        while (!st1.empty()) {
            Integer e = st1.pop();
            System.out.println("出队元素: " + e);
        }
        System.out.println("st1为空: " + st1.empty());

        //测试2
        System.out.println("*******测试2****************");
        String[] b = {"a", "b", "c", "d"};
        CycleLinkQueueClass<String> st2 = new CycleLinkQueueClass<String>();
        for (int i = 0; i < b.length; i++) {
            st2.push(b[i]);
            System.out.println("进队元素: " + b[i]);
        }
        System.out.println("st2为空: " + st2.empty());
        System.out.println("st2: " + st2);

        while (!st2.empty()) {
            String x = st2.pop();
            System.out.println("出队元素: " + x);
        }
        System.out.println("st2为空: " + st2.empty());
    }
}
